using System;
using System.Collections.Generic;
using System.Text;

namespace Sucrose.Base
{
    public class SupportItem : DownloadableItem
    {
        #region instanceVars

        private String type;

        #endregion

        #region basicProperties

        public String Type
        {
            get
            {
                return type;
            }
            set
            {
                this.type = value;
            }
        }

        #endregion

        #region constructors

        /// <summary>
        /// Creats a SupportItem object
        /// </summary>
        public SupportItem()
            : base()
        {

        }

        /// <summary>
        /// Creats a SupportItem object
        /// </summary>
        /// <param name="id">ID</param>
        /// <param name="name">Display name</param>
        /// <param name="description">Description</param>
        /// <param name="url">LMS detail page URL</param>
        /// <param name="lastModified">Date last modified</param>
        /// <param name="remoteLocation">Location of file on LMS</param>
        /// <param name="course">The course this SupportItem is part of</param>
        /// <param name="type">SupportItem type</param>
        public SupportItem(int id, String name, String description, String url, DateTime lastModified, String remoteLocation, Course course, String type) 
            : base(id, name, description, url, lastModified, course, remoteLocation)
        {
            this.type = type;
        }

        #endregion

        #region methods

        public override void Download()
        {
            try
            {
                base.Download(Settings.GetValueForKey("supportPath") + this.Course.CourseName + "\\");
            }
            catch (KeyNotFoundException) { }
            catch (Exception) { }
        }

        #endregion
    }
}
